<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>无标题文档</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<script>
	window.onload=function(){
			var count=15;
			var btn=document.getElementById("btn1");
			btn.innerHTML="秒杀倒计时"+count+"秒";
			var interval=setInterval(function(){
				count=count-1;
				console.log(count);
				if(count==0){
						console.log("aa");
						btn.innerHTML="开始秒杀";
						btn.disabled=false;
						clearInterval(interval);
					}
				else{
						btn.innerHTML="秒杀倒计时"+count+"秒";
					}
				},1000)
				
			
		}
</script>
<body>
	<div id="contain">
    	<button disabled="true" id="btn1" onclick="javascript:alert('恭喜你成功秒杀')">秒杀倒计时</button>
    </div>
</body>
</html>
